﻿using System;
using System.Collections;
using System.Xml;
using System.Text;
using InfoJetSoft.Service.Entity;
using InfoJetSoft.Service.Util;

namespace InfoJetSoft.Service.Worker
{
	
	class FormDisableNoBindingControlWorker
	{
		public static void setDisabledById( XmlElement element )
		{
			string id = element.GetAttribute(JetConstant.HTML_id);
			if (id.IndexOf("_") != 0)
			{
				element.SetAttribute(JetConstant.HTML_disabled, JetConstant.HTML_true);
			}
		}

		//CID 0236 //2009.03.03 //Begin
        public static void setDisabledOnCheckbox(XmlElement element)
		{
			XmlElement spanElement = element.ParentNode as XmlElement;
			string className = spanElement.GetAttribute( "class" );
			if( className.Equals( "xdMultiSelectListItem" ) )
			{
				//Not to disable this checkbox.
			}
			else
			{
				setDisabledById( element );
			}
		}
		//CID 0236 //2009.03.03 //End
	}
}